package terra.model;

import java.util.NoSuchElementException;

public enum Stats
{
	// HP & MP
	MAX_HP 				("maxHp"),
	REGENERATE_HP_RATE 	("regHp"),
	POWER_ATTACK		("pAtk"),
	POWER_ATTACK_SPEED 	("pAtkSpd"),
	POWER_DEFENCE 		("pDef"),
	CRITICAL_DAMAGE 	("cAtk"),
	CRITICAL_RATE 		("rCrit" ),
	ACCURACY_COMBAT 	("accCombat"),
	POWER_ATTACK_RANGE 	("pAtkRange"),
    ATTACK_COUNT_MAX    ("atkCountMax"),
	RUN_SPEED 			("runSpd"),
	STAT_STR			("STR"),
	STAT_CON 			("CON"),
	STAT_DEX 			("DEX"),
	BREATH 				("breath")
	;

	public static final int NUM_STATS = values().length;

	private String _value;

	public String getValue(){
		return _value;
	}
	private Stats(String s){
		_value = s;
	}
	
	public static Stats valueOfXml(String name)	{
		name = name.intern();
		for(Stats s: values()){
			if(s.getValue().equals(name))
				return s;
		}
		throw new NoSuchElementException("Unknown name '"+name+"' for enum Stats");
	}
}
